home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Business Master (3rd Edition)
/
The Business Master (3rd Edition).iso
/
files
/
utilstem
/
stackbat
/
bu40smll.exe
/
MENUDEMO.BAT
< prev
next >
Wrap
DOS Batch File
|
1991-12-23
|
4KB
|
105 lines
:Batutil c(o) 1990, 1991 Barry Simon and Richard Wilson
: Version 4.0
echo off
cls
batutil {inc %0 code}
goto end
:echo1
@0AWelcome to the demonstration of @8EBATUTIL@0A's menu making
@0A You can make all sorts of menus and get the user's choice returned
in the errorlevel and also in the environment. In a moment we'll
show you a typical menu. For every menu we show you'll have to
make a choice although the choice won't have any effect in this
demo. After the first we'll show you the choice made and the command to
make the menu. At any menu hitting <Esc> will exit the batch file.
Now please hit a key to continue.
:echo2
this is a choice in the menu: #1
this is a choice in the menu: #2
this is a choice in the menu: #3
this is a choice in the menu: #4
this is a choice in the menu: #5
@ This separates menu items from help text; the rest of the line is ignored
You can also display a line of text for each menu item if you wish
That way you can give up to 80 characters of extra explanation of menu items
These lines will be centered and they can be very
short
or very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
Notice that extra help lines beyond the number of menu items get ignored
:echo3
You picked choice $r
That menu was made with the command
@1FBatutil {AT=00}{CL}{MH This is a wide menu}{FM %0 echo2}
@1Ewhich uses the FMenu command to read in a menu from a file; in this
case from this batch file itself! The help text is in the same file
Do you wish to see that menu again(Y/N)?
:echo4
You picked choice $r
That menu was made with the command:
@1FBatutil $(AT 30$)$(MN 70$)$(SH$)$(MH This is a menu header$)$(ME ....$)
@1E Do you wish to see that menu again(Y/N)?
:echo5
You picked choice $r
That menu was made with the command:
@1FBatutil {PO}{FK}{ME This$$Smenu$$Shas$$Sfunction key$$Schoices$$Salso}
@1EIf one uses {PO +} instead of {PO} there are also sound effects
What is your name, please?
:echo6
You picked choice #$r
That menu was made with the command:
@1F Batutil $(MEnu a b c d e f g h i j k l m n$)
Do you wish to see that menu again(Y/N)?
:code
RC $
la start
AT=0A }{ CL }{ RO 8 }{ FP %0 echo1
{AS} if $r=27 then goto end
la firstmenu
AT=30 }{ CL }{ AT=0 }{ MN=70 }{ SH}{ PO + }{ MH $W, $E $H:$m
ME Here$Sis$Sa$Smenu$Swith many$Sfancy$Sfeatures$Senabled
if $r=0 then goto end {AT=30}
EC $_$_$_$_You picked choice $r$_ Do you wish to see that menu again (Y/N)?
{CU +} GE N CR Y {CU -} if $r=3 then goto firstmenu
AT=3F { EC $_$_ }{ CO=5 } EC Menus can be tall and thin { GE WA2 }
la secondmenu
{AT=00} CL {ME a b c d e f g h i j k l m n } AT=1E {CL} {RO=5} {CO=1}
if $r=0 then goto end
{FP %0 echo6}
{CU +} GE N CR Y {CU -} if $r=3 then goto secondmenu
{AT=4E} EC $_$_ Or menus can be short and fat {GE WA2}
la thirdmenu
{AT=0E}{CL}{MH This is a wide menu}
FM %0 echo2
if $r=0 then goto end
{AT=1E}{CL}{RO=5}{CO=1}{FP %0 echo3}
{CU +} GE N CR Y {CU -} if $r=3 then goto thirdmenu
{AT=4E} EC $_$_ Menus can have headers and/or a shadow {GE WA3}
la fourthmenu
{AT=00}{CL}{AT 30}{MN 70}{SH}{MH This is a menu header}
ME you$Scan$SpIck a$ScHoice$Swith The$Shighlighted$Scapital$Sletter
if $r=0 then goto end
{AT=1E}{CL}{RO=5}{CO=1}{FP %0 echo4}
{CU +} GE CR N Y {CU -} if $r=3 then goto fourthmenu
{AT=4E} EC $_$_ Menus can explode with or without sound effects {GE WA3}
la fifthmenu
{AT=00}{CL}{PO}{FK}{ME This$Smenu$Shas$Sfunction key$Schoices$Salso}
if $r=0 then goto end
{AT=1E}{CL}{RO=5}{CO=1}{FP %0 echo5}{$1=$Q}
{CL}{MH $1's Menu}{me eXit Last$Smenu Restart}
if $r=3 then goto start
if $r=2 then goto fifthmenu
la end
{CL}{RO 5}{CO 5}{PR Thank @1Fyou @1Efor trying @1FBATUTIL!$_}
:end